import { getItem, setItem } from '@/utils/storage'
import { DEFAULT_COLOR, MAIN_COLOR } from '../../constant'
import variables from '@/styles/variables.scss'

export default {
  namespaced: true,
  state: {
    mainColor: getItem(MAIN_COLOR) || DEFAULT_COLOR,
    variables: variables
  },
  mutations: {
    setMainColor(state, v) {
      state.variables.menuBg = v
      console.log(state.variables.menuBg)
      state.mainColor = v
      setItem(MAIN_COLOR, v)
    }
  }
}
